//
// Created by de on 3/29/21.
//

#ifndef FORCEEIGENTEST_STATESELECTION_H
#define FORCEEIGENTEST_STATESELECTION_H

#include <ros/node_handle.h>
#include "string"
#include "RosHandler/RosHandler.h"
#include "log/SqdLoger.h"
#include "Semp/CSemaphore.h"
#include "Global/GlobalVar.h"
/**
 * global var
 */
class  StateSelection{
public:
    explicit StateSelection(ros::NodeHandle *node);

    void setSqlController();


    void InfoSelectionName()
    {
//        spdlog::warn(name);
    }

    std::shared_ptr<CSemaphore>& getGloalSemap(){
        return p_Semaphore;
    }

    void setWorkResult(std::shared_ptr<WorkResult>& p_workResult);

    std::shared_ptr<WorkResult>&  getWorkResult();

    void initRosServiceClient();

    RosHandler* getRosHandler();

    ForceDeviceCommCode* getDeviceControlCode();

private:
    std::string name;
    std::shared_ptr<RosHandler> p_RosHandler;
    std::shared_ptr<CSemaphore> p_Semaphore;
    std::shared_ptr<WorkResult> p_workResult;
    ros::NodeHandle* node;

    std::shared_ptr<ForceDeviceCommCode> p_DeviceControlCode;
//    std::atomic_bool DeviceNormalStatus;
//    std::vector
};

#endif //FORCEEIGENTEST_STATESELECTION_H
